<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#add-item-modal">
<i class="icon-plus align-top bigger-125"></i> 新增广告
</button>
<!-- Modal -->
<div class="modal fade" id="add-item-modal" tabindex="-1" role="dialog" aria-labelledby="text-modal">

  <form class="form-horizontal" role="form" id="add-item-cate-form" method="POST">
  <div class="modal-dialog" role="document">
    <div class="modal-content ">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="text-modal">广告</h4>
      </div>
      <div class="modal-body">
<div class="row" style="margin-bottom: 5px;">
  <div class="col-md-12 center">
    <span class="profile-picture">
      <img id="show-add-adverise" class="editable img-responsive" src="{urlStatic('images/picture_add.jpg')}" style="max-height: 130px;" />
    </span>
  </div>
</div>



        <div class="form-group">
          <label class="col-sm-3 control-label no-padding-right"> 广告名称 </label>
          <div class="col-sm-8">
            <input type="text" class="form-control" name="name">
            <input class="hidden" name="image" id="add-adverise-image" >
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="submit"" class="btn btn-danger">添加</button>
      </div>
    </div>
  </div>
</form>
</div>
{include file='admin/upload_image.phtml' showid="show-add-adverise" callbackid="add-adverise-image" btnchoose="上传广告图片" type="gift"}
<script>
$('#add-item-cate-form').submit(function(e) {
  var _this = $(this);
  _this.attr('disabled', 'disabled');
  var data = LIVE.component.form.getData($(this));
  if (!$.trim(data['name'])) { return alert('请填分类名称') || e.preventDefault();}
  return true;
});
</script>
